home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / oasis / oasis1-1.lha / oasis-1.1 / system.h < prev    next >
C/C++ Source or Header  |  1992-05-01  |  6KB  |  187 lines

  1. /*==========================================================================*
  2.     Oasis Alpha Version 1.1               (C) Copyright 1992 Fah-Chun Cheong
  3.     Revised: 5/1/92 by: fcc@eecs.umich.edu    and The University of Michigan
  4.     ------------------------------------------------------------------------
  5.     Permission to use, copy, modify, distribute, sell and resell Oasis Alpha
  6.     software and its documentation for any purpose and without fee is hereby
  7.     granted, provided that the authorship be appropriately credited and
  8.     acknowledged, and that the above copyright notice appear in all copies
  9.     and both the copyright notice and this permission notice appear in
  10.     supporting documentation. The author makes no representations about the
  11.     suitability of this software for any purpose. It is provided "as is"
  12.     without express or implied warranty. Oasis Alpha is free, caveat emptor!
  13.     ------------------------------------------------------------------------
  14.     To request Oasis Alpha source code:   oasis-alpha-request@eecs.umich.edu
  15.     To enroll in the mailing list:        oasis-alpha-request@eecs.umich.edu
  16.     To send bug reports:                  oasis-alpha-bugs@eecs.umich.edu
  17.     To discuss openly all matters Oasis:  oasis-alpha@eecs.umich.edu
  18.  *==========================================================================*/
  19. #include                <stdio.h>
  20.  
  21. #ifdef  apollo
  22. #define VOID            int
  23. #else
  24. #define VOID            void
  25. #endif  apollo
  26.  
  27. #define NUL             0
  28.  
  29. #define T_CHAR          0x0008000f
  30. #define T_INT           0x000c000f
  31. #define T_FLOAT         0x0010000f
  32. #define T_POINTER       0x0014000f
  33.  
  34. #define H_ROOT          0x00001003
  35. #define H_HANDLE        0x00040013
  36.  
  37. #define I_HANDLE        1
  38. #define I_LISTC         2
  39. #define I_LISTI         3
  40. #define I_LISTF         4
  41. #define I_LISTP         5
  42. #define I_ARRAYC        6
  43. #define I_ARRAYI        7
  44. #define I_ARRAYF        8
  45. #define I_ARRAYP        9
  46.  
  47. #define MDONE           0
  48. #define MQUIT           1
  49. #define MSEND           2
  50. #define MCRET           3
  51.  
  52. #define SIZE            0
  53. #define ENDIAN          1
  54. #define START           2
  55. #define MTYPE           3
  56. #define ADDR            4
  57. #define PORT            5
  58. #define XID             6
  59. #define MID             7
  60. #define INO             8
  61. #define ONO             9
  62. #define HEADSZ         10
  63.  
  64. #define idof(p)         (*(u_long *) p >> 18 & 0x3fff)
  65. #define szof(p)         (*(u_long *) p >>  2 & 0x3fff)
  66.  
  67. #define error0(s)       fprintf(stderr, s)
  68. #define error1(s,a)     fprintf(stderr, s, a)
  69.  
  70. typedef struct sockaddr_in  Socket;
  71. typedef struct sockaddr     Sock;
  72. typedef struct _Host        Host;
  73. typedef struct _Space       Space;
  74. typedef struct _Thread      Thread;
  75.  
  76. struct _Host {
  77.         u_long  addr;
  78.         u_long  port;
  79. };
  80.  
  81. struct _Space {
  82.         u_long *heap;
  83.         u_long *next;
  84.         u_long *hp;
  85.         u_long *bp;
  86. };
  87.  
  88. struct _Thread {
  89.         u_long *stack;
  90.         u_long *mp;
  91.         u_long *sb;
  92.         u_long *sp;
  93.         u_long *pc;
  94.         u_long**hook;
  95.         u_long *mbuf;
  96.         u_long  addr;
  97.         u_long  port;
  98.         u_long  xid;
  99.         u_long  ono;
  100.         u_long  count;
  101.         Thread *next;
  102. };
  103.  
  104. extern  u_long          getaddr();
  105.  
  106. extern  int             random();
  107. extern  int             pick();
  108. extern  int             readn();
  109. extern  int             writn();
  110. extern  int             csocket();
  111. extern  int             ssocket();
  112. extern  char           *itoa();
  113. extern  char           *xtoa();
  114. extern  char           *ntoa();
  115. extern  void            logger();
  116. extern  void            tracer();
  117.  
  118. extern  void            init_kern();
  119. extern  void            stat_on();
  120. extern  void            stat_off();
  121. extern  u_long          run();
  122. extern  VOID            on_fault();
  123. extern  VOID            on_arrival();
  124. extern  void            reorder();
  125. extern  u_long          create();
  126. extern  void            transmit();
  127. extern  Space          *collect();
  128. extern  u_long         *trace();
  129. extern  u_long         *traverse();
  130. extern  u_long          marshal();
  131. extern  void            umarshal();
  132. extern  void            mcret();
  133. extern  void            msend();
  134. extern  u_long         *mdone();
  135. extern  u_long         *mquit();
  136. extern  u_long         *mrecv();
  137. extern  void            tinit();
  138. extern  void            tmove();
  139. extern  Thread         *twait();
  140. extern  u_long         *cwait();
  141. extern  void            cpost();
  142. extern  void            zero();
  143. extern  char           *alloc();
  144. extern  long            iceil();
  145. extern  long            ifloor();
  146. extern  long            iround();
  147. extern  long            itrunca();
  148. extern  double          ffloat();
  149. extern  u_long         *dbug();
  150.  
  151. #if     defined(M68K) || defined(I386)
  152. extern  u_long         *call();
  153. #else
  154. #define call            exec
  155. #endif  M68K || I386
  156.  
  157. extern  u_long         *exec();
  158. extern  void            done();
  159. extern  void            quit();
  160. extern  u_long          ftow();
  161. extern  double          wtof();
  162.  
  163. extern  double          drem();
  164. extern  double          ceil();
  165. extern  double          floor();
  166. extern  double          sqrt();
  167. extern  double          sin();
  168. extern  double          cos();
  169. extern  double          tan();
  170. extern  double          asin();
  171. extern  double          acos();
  172. extern  double          atan();
  173. extern  double          sinh();
  174. extern  double          cosh();
  175. extern  double          tanh();
  176. extern  double          asinh();
  177. extern  double          acosh();
  178. extern  double          atanh();
  179. extern  double          log10();
  180. extern  double          logb();
  181. extern  double          log();
  182. extern  double          log1p();
  183. extern  double          pow();
  184. extern  double          exp();
  185. extern  double          expm1();
  186.  
  187.